package com.education.platform.api.pay.alipay;


import com.alipay.api.AlipayConstants;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 支付宝支付配置
 *
 */
public class AlipayConfig {


    public static String APP_ID;
    /**
     * // 合作身份者ID，签约账号，以2088开头由16位纯数字组成的字符串，
     * 查看地址：https://b.alipay.com/order/pidAndKey.htm
     *
     */
    public static String PARTNER;
    public static String SELLER_ID;
    /**
     *  //商户的私钥,需要PKCS8格式，
     *  RSA公私钥生成：https://doc.open.alipay.com/doc2/detail.htm?spm=a219a.7629140.0.0.nBDxfy&treeId=58&articleId=103242&docType=1
     *
     */
    public static String PRIVATE_KEY;
    /**
     * // 支付宝的公钥,查看地址：https://b.alipay.com/order/pidAndKey.htm
     *
     */
    public static String ALIPAY_PUBLIC_KEY;
    /**
     *   // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
     *
     */
    public static String NOTIFY_URL;
    /**
     *   页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
      */
    public static String RETURN_URL;
    public static String SERVER_URL;
    /**
     *   签名方式
      */
    public static String SIGN_TYPE = AlipayConstants.SIGN_TYPE_RSA2;

    /**
     *  字符编码格式 目前支持utf-8
      */
    public static String INPUT_CHARSET = AlipayConstants.CHARSET_UTF8;
    /**
     * //参数返回格式，只支持json
     */
    public static String FORMAT = AlipayConstants.FORMAT_JSON;


    private static boolean use_box = false;


    static {
        if (use_box) {
            //沙箱环境

        } else {
            APP_ID = "2021001172651424";
            PARTNER = "2088831860293529";
            PRIVATE_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC2WCatjOX7OIZ8H6aGTwK4yX3NV3Ox9eJ5FB3+Z8qfcO0meYtC+2RQRPuBrWO5LMvlE0whE7fEVIIfEfwcyef/BZnphAjnHYExkHaXDiPU8rugI/8YPvQM2R0n236hPHmRQKZSPmYCrxkgX05CPjhlddlMw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j0SH2urq/JBBJDDdOVD7wGm7gNjd+3T1dYZnImpCCFc4e6Ld+UPJzgOMy1NGmp+cDI0t9OBuQrXhJnbzjMiF7zDDgK0H/rq5qWGlk7mmHrWVyy+//DlVL0OKYPvxWAiI4DODSnUmV2MU0V5d5tzO5bkiaZ4ybw1MC9L6geZUCnAoGAQs2dPcoUW/aFqu1Horuz/CE8CPBRcMq8pMrZU/i9e/ZENIOWPd6MZQtjSwo00i9GvQaQAmmLVrvWqgW3xlwYA/Ec46Wja1iah9ZSIE1nFcA1YmUqTRBfeON5VR0qVlF5YSNqu12CCvd2xOgwi78rzQYnIynwQH7D0P8ISXCQV9A=";
            ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoPjAY7bdw5qcZcW9eR3OJlS1Ksd3+S5N7AeSXmjsf3Ohk4mTGCmFVU3sF+f811B58tM/ObRKKr6YJTRtVVOwo8GayJ9mMQekBq4IdAskWLtOxgtDOlg34886I/8NbjONHISJvRrl+u8POxuIBUMGOYI0PKWROtFjnMpfGcP5t1tgdxNSsKFVLBQr73FdEAjyMVMxpvtcdI3AhVO/tqM/51nev3SLUnDt7g8UiO8NIAg7KCUA4RhDnIDykzHoXsniOdEs619FxpzounSC6/nFWDhVloa0/YLo8/dC5D6GcooGcnUQi00U1g2/+ty4k++Q1wOmKkyDe2iogSUdZbwJXQIDAQAB";
            //支付宝网关（固定）
            SERVER_URL = "https://openapi.alipay.com/gateway.do";
            //正式
            NOTIFY_URL = "http://39.106.1.151:8020/api/pay/aliCallBack";
            //测试
//            NOTIFY_URL = "http://39.106.1.151:7020/api/pay/aliCallBack";
            RETURN_URL = "";
            SELLER_ID = PARTNER;
        }
    }
//    @Value("${notify.ali-url}")
//    public  void setNotifyUrl(String notifyUrl) {
//        NOTIFY_URL = notifyUrl;
//    }
}

